import { NgModule, Optional, SkipSelf } from "@angular/core";
import { BrowserModule } from "@angular/platform-browser";
import { AppRoutingModule } from "./app-routing.module";
import { HeaderComponent } from './layouts/header/header.component';
import { BreadcrumbModule } from "./share/components/breadcrumb/breadcrumb.module";
import { DirectivesModule } from "./share/directives/directives.module";
import { RxStudyComponent } from './components/rx-study/rx-study.component';
import { ProtoTreeComponent } from './components/proto-tree/proto-tree.component';
import { NzIconModule } from 'ng-zorro-antd/icon';
import { NzTreeModule } from 'ng-zorro-antd/tree';
import { NzButtonModule } from 'ng-zorro-antd/button';

@NgModule({
  declarations: [
    HeaderComponent,
    RxStudyComponent,
    ProtoTreeComponent
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    BreadcrumbModule,
    DirectivesModule,
    NzIconModule,
    NzTreeModule,
    NzButtonModule
  ],
  exports: [
    BreadcrumbModule,
    NzIconModule,
    NzTreeModule,
    NzButtonModule,
    HeaderComponent,
    RxStudyComponent,
    ProtoTreeComponent
  ]
})
export class CoreModule {
  constructor(@SkipSelf() @Optional() parentModule: CoreModule) {
    if (parentModule) {
      throw new Error('CoreModule只能被AppModule引入');
    }
  }
}